﻿#include <iostream>
#include <map>
using namespace std;
//map容器查找和统计
void test01()
{
	//查找
	map<int, int>m;
	m.insert(pair<int,int>(1,10));
	m.insert(pair<int, int>(2, 20));
	m.insert(pair<int, int>(3, 30));
	map<int,int>::iterator pos=m.find(4);
	if (pos != m.end())
	{
		cout << "找到了" << "大小为" << pos->second << endl;
	}
	else
		cout << "没找到" << endl;
	//统计
	//map不允许插入重复元素，故结果要么是0要么是1
	cout << m.count(3) << endl;;
}
int main()
{
	test01();
}